<div class="dialog dialog-quit hidden">
    <div class="box" style="height: 390px;">
        <div class="title">
            <h4 class="fl">房产局审核对话框</h4>
            <span class="fr"><a href="#" onclick="closeDialog();">关闭</a></span>
        </div>
        <table class="form-tab">
            <tr>
                <th width="100">审批状态：</th>
                <td>
                    <input disabled="disabled" name="spzt" checked="checked" value="同意" type="checkbox" /><label>同意</label>
                    <input disabled="disabled" name="spzt" value="拒绝" type="checkbox" /><label>拒绝</label>
                    <p style="color:red;font-size:12px;">系统自动将该申请人及配偶列入黑名单2年</p>
                </td>
            </tr>
            <tr>
                <th>退还押金：</th>
                <td><input disabled="disabled" type="text" name="yajin" value="{$yajin.amount|default='未付押金'}({$yajin.name|default='无押金编号'})" /></td>
            </tr>
            <tr>
                <th>审批意见：</th>
                <td>
                    <textarea name="spyj"></textarea>
                    <select name="opinion" target="spyj" style="margin:5px 0;">
                        <option value="">--选择常用审批意见--</option>
                        <volist name="opinion" id="vo">
                            <option value="{$vo.name}">{$vo.name}</option>
                        </volist>
                    </select>
                </td>
            </tr>
            <tr>
                <th>审批日期：</th>
                <td><input type="text" name="sprq2" value="{$a|default=time()|date='Y/m/d',###}" /></td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;line-height:40px;">
                    <button class="btn btn-highlight" onclick="action_fcjSubmit();">提交</button>
                    <span>或</span>
                    <a href="#" onclick="closeDialog();" class="linkBtn">放弃</a>
                </td>
            </tr>
        </table>
    </div>
</div>
<link type="text/css" href="__JS__/autocomplete2/src/jquery.autocomplete.min.css" rel="stylesheet">
<script src="__JS__/autocomplete2/src/jquery.autocomplete.js" type="text/javascript"></script>
<script>
    function action_fcjSubmit() {
        var spzt = null;
        $("input[name=spzt]").each(function () {
            if($(this).prop("checked")){
                spzt = $(this).val();
            }
        });
        if(!spzt){
            alert("请填写审批状态");
            return false;
        }
        var spyj = $("textarea[name=spyj]").val();
        if(!spyj && spzt=="拒绝"){
            alert("请填写审批意见");
            return false;
        }

        var id = $("input[name=id]").val();
        var sprq2 = $("input[name=sprq2]").val();
        $.ajax({
            url:"/admin/quit/ajax_fcj",
            data: {id:id, spzt:spzt, spyj:spyj,sprq2:sprq2}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    alert("操作成功");
                    location.reload();
                }else{
                    console.log(data.info);
                    alert(data.info);
                }
            }
        });
    }
</script>
